package com.example.myapplication.DesignPatterns.observerable;

import com.example.myapplication.thirdcamera.util.Log;

/**
 * 观察者
 */
public class User implements Observer {

    private String name;
    private String message;

    public User(String name) {
        this.name = name;
    }

    @Override
    public void updateMessage(String message) {
        this.message = message;
        read();
    }

    private void read() {
        Log.i("dove",name + " 收到推送消息： " + message);
    }
}
